package com.yaorange.jk.web;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.apache.struts2.ServletActionContext;

/**
 * @author coach tam
 * @date 2017/11/3
 */
public class LogoutAction extends BaseAction {

    public String logout(){
        //1,注销当前session
//        ServletActionContext.getRequest().getSession().invalidate();

        //2,清空shiro中的当前用户
        Subject subject = SecurityUtils.getSubject();
        subject.logout();
        return "login";
    }
}
